// pages/detail/detail.js
Page({
  data: {
  id:'',
  way: ['退款（仅退款不退货）'],
  wayindex: 0,
  why: ['不想要了','卖家缺货','拍错了/订单信息错误','其他'],
  whyindex: 0,
  imgs:[],
  much:'0.00'
  },
  waypick: function (e) {
    this.setData({
      wayindex: e.detail.value
    });
  }, 
  whypick: function (e) {
    this.setData({
      whyindex: e.detail.value
    });
  }, 
  chooseImg: function () {
    var _this = this;
    wx.chooseImage({
      count: 5, // 默认9
      sizeType: ['compressed'], // 可以指定是原图还是压缩图，默认二者都有
      sourceType: ['album', 'camera'],
      success: function (res) {
        var tempFilePaths = res.tempFilePaths;
        _this.setData({
          imgs: res.tempFilePaths
        })
      }
    })
  },
  delete: function (e) {
    let index = e.currentTarget.dataset.index;
    var that = this;
    wx.showModal({
      title: '提示',
      content: '确定要删除吗？',
      success: function (sm) {
        if (sm.confirm) {
          var datas = that.data.imgs;
          datas.splice(index, 1);
          that.setData({ imgs: datas })
        } else if (sm.cancel) {
        }
      }
    })
  },
  onLoad: function (options) {
  
  },
  onReady: function () {
  
  }
})